format Rate
fun formatRate(rate: Double, decimalChar: Char, maxDecPlaces: Int? = null, fillZeroes: Boolean = false): String
Format a Double with a maximum of maxDecimalPlaces decimal places, while truncating any trailing zeroes, and ensuring that there are at least minDecPlaces displayed
Parameters
rate
the Double value to format as a string
decimal Char
the decimal point character to be used: either '.' or ','
max Dec Places
the maximum number of decimal places to include in the string value. If null, the number of decimal places is determined based on the magnitude of the rate parameter
fill Zeroes
if true, fill in any trailing zeroes up to maxDecimalPlaces (or the automatically determined number of decimal places)
Format a BigDecimal
Since
MD2027
Parameters
rate
the Double value to format as a string
decimal Char
the decimal point character to be used: either '.' or ','